package com.jilefojing.service;

import java.util.List;

import com.jilefojing.beans.enums.ItemTypeEnumForSource;
import com.jilefojing.beans.exception.UserContextException;
import com.jilefojing.beans.pojos.DCategory;
import com.jilefojing.beans.pojos.enhanced.EnhancedDCategory;
import com.jilefojing.beans.query.DCategoryQuery;
import com.jilefojing.beans.vo.Pagination;
import com.jilefojing.context.beans.vo.UserContext;
import com.jilefojing.service.base.IBaseService;

/**
 * 
 * @author 作者 jgshun
 * @date 创建时间 2016年07月26日 16时31分05秒
 */
public interface IDCategoryService extends IBaseService<DCategory> {
	Pagination<EnhancedDCategory> getPagination(DCategoryQuery dCategoryQuery, Pagination<EnhancedDCategory> pagination, UserContext userContext);

	List<EnhancedDCategory> conventDCategorys2EnhancedDCategories(List<DCategory> dCategories);

	List<EnhancedDCategory> getEnhancedTopDCategoriesByItemType(ItemTypeEnumForSource itemType, UserContext userContext);

	List<EnhancedDCategory> getEnhancedTopDCategoriesByItemTypes(List<ItemTypeEnumForSource> itemTypes, UserContext userContext);

	List<EnhancedDCategory> getEnhancedChildDCategoriesByParentIds(List<Long> parentIds, UserContext userContext);

	EnhancedDCategory appendEnhancedParentDCategory2EnhancedDCategory(EnhancedDCategory enhancedDCategory, UserContext userContext);

	List<EnhancedDCategory> appendEnhancedParentDCategory2EnhancedDCategories(List<EnhancedDCategory> enhancedDCategories, UserContext userContext);

	EnhancedDCategory appendEnhancedChildDCategories2EnhancedDCategory(EnhancedDCategory enhancedDCategory, UserContext userContext);

	List<EnhancedDCategory> appendEnhancedChildDCategories2EnhancedDCategories(List<EnhancedDCategory> enhancedDCategories, UserContext userContext);

	EnhancedDCategory getEnhancedDCategory(long id, UserContext userContext);

	List<EnhancedDCategory> getEnhancedDCategories(List<Long> ids, UserContext userContext);

	/**
	 * 删除实体数据
	 * 
	 * @param ids
	 * @param force
	 * @param userContext
	 * @throws UserContextException
	 */
	void deleteByIdsForEntity(List<Long> ids, boolean force, UserContext userContext) throws UserContextException;

	/**
	 * 删除非实体数据
	 * 
	 * @param ids
	 * @param force
	 * @param userContext
	 * @throws UserContextException
	 */
	void deleteByIdsForNotEntity(List<Long> ids, UserContext userContext) throws UserContextException;

	/**
	 * 只更新排序,名称
	 * 
	 * @param dCategory
	 * @param userContext
	 * @throws UserContextException
	 */
	void update(DCategory dCategory, UserContext userContext) throws UserContextException;

	/**
	 * 添加分类
	 * 
	 * @param dCategory
	 * @param userContext
	 * @throws UserContextException
	 */
	DCategory add(DCategory dCategory, UserContext userContext) throws UserContextException;

}
